#include <cairo.h>

int
main (int argc, char *argv[])
{
        //cairo_surface_t *surface1 = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 80);
        cairo_surface_t *surface2 = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 80);
        //cairo_t *cr1 = cairo_create (surface1);
        cairo_t *cr2 = cairo_create (surface2);

        //cairo_select_font_face (cr1, "SimSun", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
        //cairo_set_font_size (cr1, 32.0);
        //cairo_set_source_rgb (cr1, 0.0, 0.0, 1.0);
        //cairo_move_to (cr1, 10.0, 50.0);
        //cairo_show_text (cr1, "中文测试");

        //cairo_destroy (cr1);
        //cairo_surface_write_to_png (surface1, "test-chinese-with-simsun.png");
        //cairo_surface_destroy (surface1);

        cairo_select_font_face (cr2, "random", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
        cairo_set_font_size (cr2, 32.0);
        cairo_set_source_rgb (cr2, 0.0, 0.0, 1.0);
        cairo_move_to (cr2, 10.0, 50.0);
        cairo_show_text (cr2, "中文测试");

        cairo_destroy (cr2);
        cairo_surface_write_to_png (surface2, "test.png");
        cairo_surface_destroy (surface2);
        system("start test.png");
        return 0;
}
